<!DOCTYPE html>

<html>

<head>
  <meta charset="utf-8">
  <title>用户登录</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="${request.contextPath}/static/libs/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="${request.contextPath}/static/modules/web/kdayunadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="${request.contextPath}/static/modules/web/kdayunadmin/style/login.css" media="all">
  <link rel="icon" href="${request.contextPath}<@configValue id='CAAB580980C74A169D8AFEB418ABB5AA' orgid='${orgid}'> </@configValue>" type="image/x-icon"/>
  <style>
    .layadmin-user-login-body .layui-form-item .layui-input{
        background-color: #fff !important
    }
    .layadmin-user-login{
      background-image:url(${request.contextPath}/static/image/bg_login.jpg) ; 
      background-size:100% 100%;
      overflow: hidden;
    }
    .layadmin-user-login-footer,.layadmin-user-login-footer a{
      color:#d9d9d9
    }
    .layadmin-user-login-footer{
      background: url(/kdayun/static/image/bg_02.png) repeat;
    }  
    .layadmin-user-login-main{ 
      background:rgba(255, 255, 255, 0.8);
      border-radius:4px;
      position: absolute;
      top: 23%;
      right: 9%;
    }
    .layui-tab {
        margin: 0;
    }
    .layui-tab-title li {
        min-width: 0;
        padding: 0 5px;
    }
    .layui-tab-title {
        border-bottom-width: 0;
        border-bottom-style: none;
    }
    #wechat_login_qr_container {
        text-align: center;
    }
    #wechat_login_error_container{
        text-align: center;
        padding-top: 36px;
        width: 335px;
        height: 367px;
    }
    #wechat_login_error_header{
        margin-bottom: 30px;
    }
    .zlui-icon-wechat-msg-success:before {
        font-size: 95px;
        color: #09BB07;
    }
    .zlui-icon-wechat-msg-warn:before {
        font-size: 95px;
        color: #F43530;
    }
    .zlui-icon-wechat-msg-info:before {
        font-size: 95px;
        color: #10AEFF;
    }
    #wechat_login_error_body{
        color: black;
        margin-bottom: 25px;
        padding: 0 20px;
        line-height: 1.6;
    }
    #wechat_login_error_body h4{
        display: block;
        margin-block-start: 1.33em;
        margin-block-end: 1.33em;
        margin-inline-start: 0px;
        margin-inline-end: 0px;
        margin-bottom: 5px;
        font-weight: 400;
        font-size: 20px;
    }
    @media screen and (max-width: 768px) {
      .layadmin-user-login-main{ 
        top: 15%;
        right: 15%;
      }
    }
  </style>
</head>

<body>

  <div class="layadmin-user-login" id="" style="display: none;">
    <div class="layadmin-user-login-main">
      <div id="LAY-user-login-header-container" class="layadmin-user-login-box layadmin-user-login-header" style="padding-bottom: 0px">
        <h2 id="LAY-user-login-title">用户登录</h2>
        <p>
          <@configValue orgid='${orgid}' id=Global.SYSOPTKEY_SYSNAME> </@configValue>
        </p>
      </div>
      <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
        <form class="layui-form">
          <#--账户初始密码-->
          <input type="hidden" value="<@configValue id='8E29D02A0F9A492DBC5D7444009A4F28' orgid='${orgid}'> </@configValue>" name="initpassword">
          <input type="hidden" value="0" name="isSms" autocomplete="off">
          <input type="hidden" value="${vcodekey}" name="vcodekey">
          <input type="hidden" value="" name="ccc">
          <div id="LAY-user-login-container">
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>
                    <input type="text" name="ZHANGHM" id="LAY-user-login-username" lay-verify="ZHANGHM" placeholder="用户名" class="layui-input" maxlength="20">
                </div>
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                    <input type="password" autocomplete="off" name="abcd" id="LAY-user-login-password" lay-verify="pass" placeholder="密码" class="layui-input" maxlength="16">
                </div>
                <@configNot id=Global.SYSOPTKEY_YANZM value='none' orgid='${orgid}'>
                <div class="layui-form-item" >
                    <div class="layui-row">
                        <div class="layui-col-xs7">
                            <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>
                            <input type="text" name="vcode" id="LAY-user-login-vercode"  autocomplete="off" lay-verify="vcode" placeholder="图形验证码"
                            class="layui-input" maxlength="8">
                        </div>
                        <div class="layui-col-xs5">
                            <div style="margin-left: 10px;">
                                <img id="captchaImg" src="${request.contextPath}/captcha.jpg?vcodekey=${vcodekey}&type=<@configValue id=Global.SYSOPTKEY_YANZM orgid='${orgid}'> </@configValue>" class="layadmin-user-login-codeimg" id="LAY-user-get-vercode">
                            </div>
                        </div>
                    </div>
                </div>
                </@configNot>
                <div class="layui-form-item">
                    <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit">登 录</button>
                </div>
          </div>
          <#--忘记密码？-->         
          <div class="layui-form-item" style="margin-bottom:0px">     
            <@config id=Global.SYSOPTKEY_ISOPENZHUC orgid='${orgid}'>
                <a href="${request.contextPath}/regedit?orgid=${orgid}" class="layadmin-user-jump-change layadmin-link" >注册帐号</a>
            </@config>
            <@configNot id='AE4BCDCF0D3F49438F2814DDD987C6F6' value='none' orgid='${orgid}'>
                <a href="forget?orgid=${orgid}" class="layadmin-user-jump-change layadmin-link" style="padding-right: 10px;">忘记密码</a>
            </@configNot>
          </div>
          
          
          <div class="layui-form-item layadmin-user-login-other" style="padding-top:0; margin-bottom:0">
            <div class="layui-tab" id="LAY-tab-login-type" lay-filter="LAY-tab-login-type"  data-previous-index="0">
                <ul class="layui-tab-title">
                    <li class="layui-this" data-login-type="userNameLogin" title="账号密码登录">
                        <i class="layui-icon layui-icon-password" title="账号密码登录" style="color: #4DAF29;"></i>
                    </li>
                    <@configNot id=Global.SYSOPTKEY_PHONEINFO value='none' orgid='${orgid}'>
                    <li data-login-type="phoneLogin" title="手机短信登录">
                        <i class="layui-icon layui-icon-cellphone-fine" title="手机短信登录" style="color: #4DAF29;"></i>
                    </li>
                    </@configNot>
                    <@config id=Global.SYSOPTKEY_WECHATLOGIN value='1' orgid='${orgid}'>
                    <li data-login-type="wechatLogin" title="微信登录">
                        <i class="layui-icon layui-icon-login-wechat" title="微信登录"></i>
                    </li>
                    </@config>
                    <!--
                    <li data-login-type="qqLogin">
                        <i class="layui-icon layui-icon-login-qq"></i>
                    </li>
                    <li data-login-type="weiboLogin">
                        <i class="layui-icon layui-icon-login-weibo"></i>
                    </li>
                   -->
                </ul>
            </div>

          </div>
        </form>
      </div>
    </div>

    <div class="layui-trans layadmin-user-login-footer">
      <#include "/web/foot.ftl" />
    </div>
  </div>

  <script src="${request.contextPath}/static/libs/layui/layui.js"></script>
  <script type="text/javascript" src="${request.contextPath}/static/libs/md5.js" type="text/javascript"></script>
  <script type="text/javascript" src="${request.contextPath}/static/libs/store.min.js" type="text/javascript"></script>
  <!-- 微信扫描登录js -->
  <!-- <script crossorigin="anonymous" integrity="sha256-b/7ix06s1RNq6TgSFoCdAG7ZHFjtXOkZ5XBJksfFuNgGY=" type="text/javascript" src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script> -->
  <script>
    var script = document.createElement('script');
    script.type = 'text/javascript';

    // <!-- 微信扫描登录js -->
    script.src = 'http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js';
    document.head.appendChild(script);

  </script>
  <script>
    console.info(top);
    if (window != top) {
      top.location.href = location.href;
    }
    function getOrgCode() {
      var url = window.location.href;
      url = url.replace('//', '');
      url = url.split(';')[0];
      url = url.split('?')[0];
      url = url.split('#')[0];
      var items = url.split("/");
      url = items[items.length - 1];
      var re = /^[0-9]+.?[0-9]*/;
      if (re.test(url)) {
        return url;
      } else {
        return '';
      }
    }
    layui.config({
			version: "<@configVersion suosxt='CORE'> </@configVersion>"
			, base: '${request.contextPath}/static/framework/' //静态资源所在路径
      , contentPath: '${request.contextPath}'
    }).use(['zlConfig', 'zlContext', 'layer', 'form','element'], function () {
        var $ = layui.$
        , zlContext = layui.zlContext
        , layer = layui.layer
        , zlConfig = layui.zlConfig
        , statusName = zlConfig.global.result.statusName
        , msgName = zlConfig.global.result.msgName
        , dataName = zlConfig.global.result.dataName
        , ERROR = zlConfig.global.result.errorState
        , OK = zlConfig.global.result.okState
        , form = layui.form
        , element = layui.element;
        form.render();
        form.verify({
            ZHANGHM: function (value, item) { //value：表单的值、item：表单的DOM对象
                if (value == "") {
                    return '用户名不能为空';
                }
                if (!new RegExp("^[a-zA-Z0-9_\u4e00-\u9fa5\\s·]+$").test(value)) {
                    return '用户名不能有特殊字符';
                }
                if (/(^\_)|(\__)|(\_+$)/.test(value)) {
                    return '用户名首尾不能出现下划线\'_\'';
                }
            }
            , pass: function (value, item) {
                if (value == "") {
                    return '密码不能为空';
                }
            }
            , vcode: function (value, item) {
                if (value == "") {
                    return '验证码不能为空';
                }
            }
        });

        //登录类型tab，默认只有一项时不展示
        if($('#LAY-tab-login-type .layui-tab-title li').length <= 1){
            $("#LAY-tab-login-type").hide();
        }
        
        var userLoginAction = {
            vcodeImgUrl: function(){
                //图形验证码URL
                var imgUrl = "${request.contextPath}/captcha.jpg?vcodekey=${vcodekey}&type=simple&t=" + Math.floor(Math.random() * 100);
                <@configNot id=Global.SYSOPTKEY_YANZM value='none' orgid='${orgid}'>
                    imgUrl = "${request.contextPath}/captcha.jpg?vcodekey=${vcodekey}&type=<@configValue id=Global.SYSOPTKEY_YANZM orgid='${orgid}'> </@configValue>&t=" + Math.floor(Math.random() * 100);
                </@configNot>
                return imgUrl;
            },
            reloadVcode: function(){
                //刷新图形验证码
                $("#captchaImg").prop("src", userLoginAction.vcodeImgUrl());
            },
            getSmsCode: function(){
                //短信验证码
                var phone = $("#LAY-user-login-cellphone").val();
                if(!zlContext.verifyPhone(phone,"请输入正确的手机号")){
                    $("#LAY-user-login-cellphone").focus();
                    return false;
                }
                var vcode = $("#LAY-user-login-vercode").val();
                <@config id=Global.SYSOPTKEY_ISOPENPHONEPICYZM value='1' orgid='${orgid}'>                 
                    if(!vcode){
                        layer.msg("请输入图形校验码");
                        $("#LAY-user-login-vercode").focus();
                        return false;
                    }
                </@config>
                //校验手机号是否存在
                var hasExisted = true;
                zlContext.asyncGet(layui.cache['contentPath'] + "/core/sms/phone/hasexisted",{'phone': phone}, function(result){
                    if(OK == result[statusName]){
                        if(result[dataName] && "1" != result[dataName].hasExisted){
                            hasExisted = false;
                        }
                    }
                },true)
                //手机未注册
                if(!hasExisted){
                    layer.msg("该手机号未注册，请先进行注册");
                    return false;
                }
                var vcodekey = $('input[name="vcodekey"]').val();
                var param = {
                    'phone': phone,
                    'vcode': vcode,
                    'vcodekey': vcodekey,
                    'orgid': '${orgid}'
                }
                zlContext.get(layui.cache['contentPath'] + "/core/sms/send/login/smscode",param,function(result){
                    if(OK == result[statusName]){
                        zlContext.successMsg(result[msgName]);
                    }else{
                        userLoginAction.reloadVcode();
                        zlContext.errorMsg(result[msgName]);
                    }
                },true);
                zlContext.setCountdown(60,'LAY-user-getsmscode',true);
            },
            phoneLogin: function(){
                //手机号登录界面
                $('input[name="isSms"]').val("1");
                $("#LAY-user-login-container").empty();
                $('#LAY-user-login-header-container').empty();
                var header = [
                    '<h2 id="LAY-user-login-title">手机短信登录</h2>'
                    ,'<p><@configValue orgid="${orgid}" id=Global.SYSOPTKEY_SYSNAME> </@configValue></p>'
                ]
                $('#LAY-user-login-header-container').append(header.join(''));
                var content = [
                    '<div class="layui-form-item">'
                    ,'  <label class="layadmin-user-login-icon layui-icon layui-icon-cellphone" for="LAY-user-login-cellphone"></label>'
                    ,'  <input type="text" name="cellphone" id="LAY-user-login-cellphone" lay-verify="required|phone" placeholder="请输入注册时的手机号" class="layui-input">'
                    ,'</div>'
                    ,'<div class="layui-form-item" id="picyzm">'
                    ,'  <div class="layui-row">'
                    ,'    <div class="layui-col-xs7">'
                    ,'      <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>'
                    ,'      <input type="text" name="vcode" id="LAY-user-login-vercode" lay-verify="vcode" placeholder="图形验证码" class="layui-input">'
                    ,'    </div>'
                    ,'    <div class="layui-col-xs5">'
                    ,'      <div style="margin-left: 10px;">'
                    ,'        <img id="captchaImg" src="' + userLoginAction.vcodeImgUrl() + '" class="layadmin-user-login-codeimg" id="LAY-user-get-vercode">'
                    ,'      </div>'
                    ,'    </div>'
                    ,'   </div>'
                    ,'</div>'
                    ,'<div class="layui-form-item">'
                    ,'  <div class="layui-row">'
                    ,'    <div class="layui-col-xs7">'
                    ,'      <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-smscode"></label>'
                    ,'      <input type="text" name="vercode" id="LAY-user-login-smscode" lay-verify="required" placeholder="短信验证码" class="layui-input">'
                    ,'    </div>'
                    ,'    <div class="layui-col-xs5">'
                    ,'      <div style="margin-left: 10px;">'
                    ,'        <button type="button" class="layui-btn layui-btn-primary layui-btn-fluid" id="LAY-user-getsmscode">获取验证码</button>'
                    ,'      </div>'
                    ,'     </div>'
                    ,'    </div>'
                    ,'</div>'
                    ,'<div class="layui-form-item">'
                    ,'  <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit">登 录</button>'
                    ,'</div>'
                ];
                $("#LAY-user-login-container").append(content.join(''));
                <@configNot id=Global.SYSOPTKEY_ISOPENPHONEPICYZM value='1' orgid='${orgid}'>
                   $('#picyzm').hide();
                   $('input[name="vcode"]').attr('lay-verify','');    
                </@configNot>
                form.render();
                return false;
            },
            userNameLogin: function(){
                //用户名登录界面
                $('input[name="isSms"]').val("0");
                $("#LAY-user-login-container").empty();
                $('#LAY-user-login-header-container').empty();
                var header = [
                    '<h2 id="LAY-user-login-title">用户登录</h2>'
                    ,'<p><@configValue orgid="${orgid}" id=Global.SYSOPTKEY_SYSNAME> </@configValue></p>'
                ]
                $('#LAY-user-login-header-container').append(header.join(''));
                var content = [
                    '<div class="layui-form-item">'
                    ,'  <label class="layadmin-user-login-icon layui-icon layui-icon-username" for="LAY-user-login-username"></label>'
                    ,'  <input type="text" name="ZHANGHM" id="LAY-user-login-username" lay-verify="username" placeholder="用户名"  class="layui-input">'
                    ,'</div>'
                    ,'<div class="layui-form-item">'
                    ,'  <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>'
                    ,'  <input type="password" autocomplete="off" name="abcd" id="LAY-user-login-password" lay-verify="pass" placeholder="密码" class="layui-input">'
                    ,'</div>'
                ];
                $("#LAY-user-login-container").append(content.join(''));
                <@configNot id=Global.SYSOPTKEY_YANZM value='none' orgid='${orgid}'>
                content = [
                     '<div class="layui-form-item" >'
                    ,'    <div class="layui-row">'
                    ,'        <div class="layui-col-xs7">'
                    ,'            <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" for="LAY-user-login-vercode"></label>'
                    ,'            <input type="text" name="vcode" id="LAY-user-login-vercode" lay-verify="vcode" placeholder="图形验证码"'
                    ,'            class="layui-input" maxlength="8">'
                    ,'        </div>'
                    ,'        <div class="layui-col-xs5">'
                    ,'            <div style="margin-left: 10px;">'
                    ,'                <img id="captchaImg" src="' + userLoginAction.vcodeImgUrl() + '" class="layadmin-user-login-codeimg" id="LAY-user-get-vercode">'
                    ,'           </div>'
                    ,'       </div>'
                    ,'   </div>'
                    ,'</div>'
                ];
                $("#LAY-user-login-container").append(content.join(''));
                </@configNot>
                content = [
                     '<div class="layui-form-item">'
                    ,'  <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit">登 录</button>'
                    ,'</div>'
                ];
                $("#LAY-user-login-container").append(content.join(''));
                <#--记录最后一次登录用户名-->
                <@config id=Global.SYSOPTKEY_ISRMLOGINNAME value='1' orgid='${orgid}'>
                $('input[name="ZHANGHM"]').val(store.get('ZHANGHM'));
                $('input[name="abcd"]').val('');
                </@config>
                form.render();
                return false;
            },
            wechatLogin: function(){
                //微信扫描登录界面
                $("#LAY-user-login-title").text("微信扫码登录");
                $('#LAY-user-login-container').empty();
                $('#LAY-user-login-header-container').empty();
                $('#LAY-user-login-container').append('<div id="wechat_login_qr_container"></div>');
                //获取请求参数
                var qrParams = undefined;
                var errorMsg = undefined;
                var params = {
                    'orgcode': '${orgcode}',
                    'loginUrl': encodeURI(location.href)
                };
                zlContext.asyncGet(layui.cache['contentPath'] + '/web/ssologin/wechat/index', params,function(result){
                    if(OK == result[statusName] && result[dataName]){
                        qrParams = result[dataName];
                    }else{
                        errorMsg = result[msgName];
                        zlContext.errorMsg(errorMsg);
                    }
                });
                if(qrParams){
                    var obj = new WxLogin({
                        self_redirect:true,
                        id:"wechat_login_qr_container", 
                        appid: qrParams['appid'], 
                        redirect_uri: qrParams['redirectUri'],
                        response_type: qrParams['responseType'],
                        scope: qrParams['scope'], 
                        state: qrParams['state']
                    });
                }else{
                    //显示无法加载微信二维码
                    var content = [
                        '<div id="wechat_login_error_container">'
                        ,'  <div id="wechat_login_error_header">'
                        ,'      <i class="zlui-icon zlui-icon-wechat-mgs zlui-icon-wechat-msg-info"></i>'
                        ,'  </div>'
                        ,'  <div id="wechat_login_error_body">'
                        ,'      <h4>' + (errorMsg != undefined ? errorMsg : '无法加载微信二维码')+ '</h4>'
                        ,'  </div>'
                        ,'</div>'
                    ]
                    $('#LAY-user-login-container').empty();
                    $('#LAY-user-login-container').append(content.join(''));
                }
            }
        }

        element.on('tab(LAY-tab-login-type)', function(data){
            var that = $(this);
            var loginType = that.data('login-type');
            var preIndex = $(data.elem).data('previous-index')*1;
            if(loginType && userLoginAction[loginType]){
                //判断是否点击同一个tab
                if(data.index != preIndex){
                    userLoginAction[loginType].call(this, that);
                }
            }
            $(data.elem).data('previous-index', '' + data.index);
        });

        //点击刷新图形验证码
        $('#LAY-user-login-container').on('click', '#captchaImg', function(){
            userLoginAction.reloadVcode();
        });
        //点击获取短信验证码
        $('#LAY-user-login-container').on('click', '#LAY-user-getsmscode', function(){
            userLoginAction.getSmsCode();
        });
     
        <#--记录最后一次登录用户名-->
        <@config id=Global.SYSOPTKEY_ISRMLOGINNAME value='1' orgid='${orgid}'>
        $('input[name="ZHANGHM"]').val(store.get('ZHANGHM'));
        $('input[name="abcd"]').val('');
        </@config>

        $(document).on("keydown",function(e) {
            e = e ? e : event;// 兼容FF
            if (e.keyCode == 13) {
                $("button[lay-filter='LAY-user-login-submit']").click();//提交按钮的id
                return false;//防止页面跳转刷新掉
            }
        });

        form.on('submit(LAY-user-login-submit)', function (data) {
            var coreuser = {};
            var isSms = $('input[name="isSms"]').val();
            $("input[name='ccc']").val($("input[name='abcd']").val());
            $("input[name='abcd']").val(md5($("input[name='abcd']").val()).toUpperCase());
            coreuser.isSms = isSms;
            if ('1' == isSms) {
                coreuser.ZHANGHM = $("#LAY-user-login-cellphone").val();
                coreuser.smsCode = $("#LAY-user-login-smscode").val();
            } else {
                coreuser.ZHANGHM = $('input[name="ZHANGHM"]').val();
                coreuser.PSW = $('input[name="abcd"]').val();
            }
            coreuser.ORGID = '${orgid}';
            coreuser.validCode = $('input[name="vcode"]').val();
            coreuser.vcodekey = $('input[name="vcodekey"]').val();
            coreuser.orgCode = getOrgCode();
            coreuser.loginUrl = location.href;
            var index = layer.msg('正在登录中，请稍候...', { time: false, shade: [0.1, '#393D49'] });
            $.post(
                '${request.contextPath}/core/security/login',
                coreuser,
                function (data) {
                    layer.close(index);
                    var newdata = eval('(' + data + ')');
                    if (newdata.state == 'OK') {
                        store.set('ZHANGHM', coreuser.ZHANGHM);
                        var params = { optid: "251D4C26BA3F4416A65AA3B1DC76C3F6" };
                        $.post(
                            '${request.contextPath}/manager/coresysopt/querybyid?${tokenidname}=' + newdata.obj["tokenId"],
                            params,
                            function (sdata) {
                                var k = eval('(' + sdata + ')');
                                if (k.state == 'OK') {
                                    if (md5(k.obj).toUpperCase() != newdata.obj.userCursor["PSW"]) {
                                        $.post('${request.contextPath}/core/queryindex?${tokenidname}=' + newdata.obj["tokenId"],{orgid:newdata.obj.ORGID},function(indexdata){
                                            var  indexdata = eval('(' + indexdata + ')');
                                            if (indexdata.state == 'OK') {  
                                                location.href = '${request.contextPath}'+ indexdata.obj;
                                            }else{
                                                layer.msg(indexdata.msg);
                                                $("input[name='abcd']").val($("input[name='ccc']").val());
                                            }
                                        });
                                    } else {
                                        location.href = '${request.contextPath}/firstChangePwd?${tokenidname}=' + newdata.obj["tokenId"];                                         
                                    }
                                } else {
                                    layer.msg(k.msg);
                                    $("input[name='abcd']").val($("input[name='ccc']").val());
                                }
                            });
                    } else {
                        userLoginAction.reloadVcode();
                        layer.msg(newdata.msg);
                        $("input[name='abcd']").val($("input[name='ccc']").val());
                    }
                }
            ).error(function (xhr, status, info) {
                layer.close(index);
                layer.msg('网络故障:' + info);
            });
            return false;
        });

        // 获取背景图片 Math.floor(Math.random()*(max-min+1)+min);        
        zlContext.headerAjax(layui.cache['contentPath'] + "/manager/coresysopt/querybyid", "post", { "optid": "C01A0E1BC05343CAA3737B63539E5A67","orgid":"${orgid}" }, function (data) {
            if (data.state == 'OK') {
                var v = new Array;
                if (data.obj) {
                    v = eval('(' + data.obj + ')');
                }
                var random = Math.floor(Math.random() * 4);
                var pic;
                if (v) {
                    if (random <= v.length && v[random]) {
                        pic = v[random];
                    } else {
                        pic = v[0];
                    }                    
                }                
                if(pic){
                    $('.layadmin-user-login').css("background-image", "url("+layui.cache['contentPath'] + pic+")");                        
                }                
            }
            $(".layadmin-user-login").fadeIn(1000);
        });   
        <@configNot id=Global.SYSOPTKEY_APPDOWNADD value="" orgid="${orgid}">
            var orgid = "${orgid}",
                orgcode = "${orgcode}";

            if(orgid){
                var setUrl = window.location.host+","+orgid+","+orgcode;
                $(".layadmin-user-login-footer").css("line-height","45px");
                $('#appdownqrcode').attr('src',layui.cache['contentPath']+"/core/appdownQr?orgid="+orgid+"&t="+Math.floor(Math.random() * 100));
                $('#appsetqrcode').attr('src',layui.cache['contentPath']+"/core/appsetQr?content="+setUrl+"&t="+Math.floor(Math.random() * 100));

            }else{
                $('#appsetqrcode').hide();
                $('#appdownqrcode').hide();
                $('#appsetspan').hide();
                $('#appdownspan').hide();
            }
        </@configNot>
    });

  </script>

  <!-- 添加发生重大事件获取哀悼日需要把网站变灰的样式 -->
  <@config id = Global.SYSOPTKEY_ISOPENZHIHUI orgid = "${orgid}" >
      <link id="filterCss" rel="stylesheet" href="${request.contextPath}/static/modules/manager/css/filter.css?v=<@configVersion suosxt='CORE'> </@configVersion>" media="all">
  </@config>
</body>
</html>